<template>
	<view class="securityStaffDetail">
		<view class="process-cont">
			<!-- <view class="title">
				<view>名称：{{userObj.workflow_name}}</view>
				<view>分类：{{userObj.category_name}}</view>
			</view> -->
			<view >
				<view class="process-content" v-if="clapflowStep.publishInfo != null">
					<view class="process-left">
						<view class="num">{{ index + 1 }}</view>
					</view>
					<view class="process-right">
						<view style="display: flex;">
							<view>{{clapflowStep.publishInfo.photo_remarks}}</view>
							<view style="font-size: 10px;">（{{clapflowStep.publishInfo.building_number}}）</view>
						</view>
						<view style="font-size: 10px;color: #999">{{clapflowStep.publishInfo.begin_time}}</view>
						<view style="display: flex;">
							<view style="width: 100px;height: 100px;" v-if="clapflowStep.publishInfo.first_photo != null">
								<image style="width: 100%;height: 100%;" @click="imageBig(clapflowStep.publishInfo.first_photo)" :src="clapflowStep.publishInfo.first_photo" mode=""></image>
							</view>
							<view style="width: 100px;height: 100px;" v-if="clapflowStep.publishInfo.second_photo != null">
								<image style="width: 100%;height: 100%;" @click="imageBig(clapflowStep.publishInfo.second_photo)" :src="clapflowStep.publishInfo.second_photo" mode=""></image>
							</view>
							<view style="width: 100px;height: 100px;" v-if="clapflowStep.publishInfo.the_third_photo != null">
								<image style="width: 100%;height: 100%;" @click="imageBig(clapflowStep.publishInfo.the_third_photo)" :src="clapflowStep.publishInfo.the_third_photo" mode=""></image>
							</view>
						</view>
					</view>
					
				</view>
				
				<view class="process-content" v-if="clapflowStep.dispatchList != null">
					<view class="process-left">
						<view class="num">{{ index + 2 }}</view>
					</view>
					<view class="process-right">
						<view>
							处理人：{{clapflowStep.taskInfo.userName}}
						</view>
						<view style="display: flex;">
							<view>{{clapflowStep.taskInfo.processing_details}}</view>
							<!-- <view style="font-size: 10px;">（{{clapflowStep.taskInfo.building_number}}）</view> -->
						</view>
						<view style="font-size: 10px;color: #999">{{clapflowStep.taskInfo.create_time}}</view>
						<view style="display: flex;">
							<view style="width: 100px;height: 100px;" v-if="clapflowStep.taskInfo.details_first_photo != null">
								<image style="width: 100%;height: 100%;" @click="imageBig(clapflowStep.taskInfo.details_first_photo)" :src="clapflowStep.taskInfo.details_first_photo" mode=""></image>
							</view>
						</view>
					</view>
					
				</view>
				
				<view class="process-content" v-for="(item,index) in clapflowStep.dispatchList" v-if="clapflowStep.dispatchList.length != null">
					<!-- <view class="process-left">
						<view class="num">{{ index + 3 }}</view>
					</view> -->
					<view class="process-right" >
						<view>接单人：{{item.userName}}</view>
						<view style="display: flex;">
							<view>{{item.end_of_personal_task}}</view>
							<!-- <view style="font-size: 10px;">（{{clapflowStep.taskInfo.building_number}}）</view> -->
						</view>
						<view style="font-size: 10px;color: #999">{{item.create_time}}</view>
						<view style="display: flex;">
							<view style="width: 100px;height: 100px;" v-if="item.end_of_personal_first_photo != null">
								<image style="width: 100%;height: 100%;" @click="preview(item.end_of_personal_first_photo)" :src="item.end_of_personal_first_photo" mode=""></image>
							</view>
							<view style="width: 100px;height: 100px;" v-if="item.end_of_personal_second_photo != null">
								<image style="width: 100%;height: 100%;" @click="preview(item.end_of_personal_second_photo)" :src="item.end_of_personal_second_photo" mode=""></image>
							</view>
							<view style="width: 100px;height: 100px;" v-if="item.end_of_personal_the_third_photo != null">
								<image style="width: 100%;height: 100%;" @click="preview(item.end_of_personal_the_third_photo)" :src="item.end_of_personal_the_third_photo" mode=""></image>
							</view>
						</view>
					</view>
					
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				clapflowStep:{},
				clapflowStepend:[],
				index:0,
				id:null,
			};
		},
		onLoad(options) {
			this.id =options.id 
			// if(options.id){
			// 	// this.getdeleteClapData(options.id)
			// }
		},
		onShow() {
			this.getdeleteClapData()
		},
		methods:{
			getdeleteClapData(id){
				this.$request.api.deleteClapData({
					id:this.id
				}).then(res=>{
					this.clapflowStep = res.data.data
					// this.clapflowStepend = res.data.data.dispatchList
					// console.log(this.clapflowStepend)
				})
			},
			//点击图片放大
			imageBig(url){
				uni.previewImage({
					urls: [url], //需要预览的图片http链接列表，多张的时候，url直接写在后面就行了
				})
			},
			// 图片预览
			preview(val) {
				uni.previewImage({
					urls: [val],
					current: 0,
					longPressActions: {
						success: function(data) {
							console.log('选中了第' + (data.tapIndex + 1) + '个按钮,第' + (data.index + 1) + '张图片');
						},
						fail: function(err) {
							console.log(err.errMsg);
						}
					}
				});
			},
		}
	}
</script>

<style lang="scss">
	.securityStaffDetail{
		.process-cont{
			padding: 30rpx 36rpx;
			.video-info{
				background:#FFFFFF;
				padding:28rpx;
				box-shadow: 0px 2rpx 10rpx 0rpx rgba(153, 153, 153, 0.1);
				border-radius: 12rpx;
				text-align: center;
			}
			.title{
				font-size: 32rpx;
				font-family: PingFangSC-Medium, PingFang SC;
				font-weight: 500;
				color: #333333;
				padding-bottom: 30rpx;
				display: flex;
				justify-content: space-between;
				align-items: center;
				.title-edit{
					display: flex;
					align-items: center;
					color: #578EF0;
					.edit-icon{
						width: 28rpx;
						height: 27rpx;
						margin-left: 12rpx;
					}
				}
			}
			.process-content{
				display: flex;
				justify-content: space-between;
				margin-bottom: 30rpx;
				
				.process-left{
					.num{
						width: 60rpx;
						height: 60rpx;
						background: #427705;
						border-radius: 30rpx;
						text-align: center;
						line-height: 60rpx;
						color: #FFFFFF;
					}
					.line{
						margin:10rpx auto;
						height: calc(100% - 52rpx);
						width: 2rpx;
						background: #427705;
					}
					
				}
				.process-right{
					width: 323px;
					padding:28rpx;
					font-size: 28rpx;
					font-family: PingFangSC-Regular, PingFang SC;
					font-weight: 400;
					color: #333333;
					line-height: 42rpx;
					box-shadow: 0px 2rpx 10rpx 0rpx rgba(153, 153, 153, 0.1);
					border-radius: 12rpx;
					background: #FFFFFF;
					.process-img{
						max-width: 267px;
						margin:20rpx auto;
					}
					.edit-text{
						text-align: right;
						font-size: 28rpx;
						font-family: PingFangSC-Regular, PingFang SC;
						font-weight: 400;
						color: #578EF0;
					}
				}
			}
		}
		.footer-btn{
			display: flex;
			justify-content: space-between;
			padding-bottom: 30rpx;
		}
	}
</style>
